home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS03.ADF
/
C
/
cr2lf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-04-02
|
367b
|
27 lines
/* This filter changes CR to LF.
* If you 'type' a file, and it all appears on one line,
* it has only CR (carriage returns), and needs LFs instead.
*
* Usage:
* cr2lf < infile > outfile
*
* By John Foust
*/
#include "stdio.h"
main()
{
int c;
while ((c=getchar())!=EOF) {
if (c==13)
putchar(10);
else
putchar(c);
}
}